using CoreManager.Models.DTOs;

namespace CoreManager.Services.Roles
{
    /// <summary>
    /// 角色服务接口
    /// </summary>
    public interface IRoleService
    {
        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        Task<ApiResponse<List<RoleDto>>> GetRolesAsync(RoleQueryDto query);

        /// <summary>
        /// 根据ID获取角色详情
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <returns></returns>
        Task<ApiResponse<RoleDto>> GetRoleByIdAsync(int id);

        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="createDto">创建角色DTO</param>
        /// <returns></returns>
        Task<ApiResponse<RoleDto>> CreateRoleAsync(CreateRoleDto createDto);

        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <param name="updateDto">更新角色DTO</param>
        /// <returns></returns>
        Task<ApiResponse<RoleDto>> UpdateRoleAsync(int id, UpdateRoleDto updateDto);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <returns></returns>
        Task<ApiResponse<bool>> DeleteRoleAsync(int id);

        /// <summary>
        /// 批量删除角色
        /// </summary>
        /// <param name="ids">角色ID列表</param>
        /// <returns></returns>
        Task<ApiResponse<bool>> BatchDeleteRolesAsync(List<int> ids);

        /// <summary>
        /// 分配角色权限
        /// </summary>
        /// <param name="assignDto">权限分配DTO</param>
        /// <returns></returns>
        Task<ApiResponse<bool>> AssignRolePermissionsAsync(AssignRolePermissionsDto assignDto);

        /// <summary>
        /// 获取角色的菜单权限
        /// </summary>
        /// <param name="roleId">角色ID</param>
        /// <returns></returns>
        Task<ApiResponse<List<MenuDto>>> GetRoleMenusAsync(int roleId);

        /// <summary>
        /// 检查角色编码是否存在
        /// </summary>
        /// <param name="roleCode">角色编码</param>
        /// <param name="excludeId">排除的角色ID</param>
        /// <returns></returns>
        Task<ApiResponse<bool>> CheckRoleCodeExistsAsync(string roleCode, int? excludeId = null);

        /// <summary>
        /// 更新角色状态
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <param name="status">状态</param>
        /// <returns></returns>
        Task<ApiResponse<bool>> UpdateRoleStatusAsync(int id, int status);
    }
}
